package cn.yili12.server.client.handler;

import cn.yili12.server.client.vo.ClientMessage;
import cn.yili12.server.info.vo.InfoMessage;
import cn.yili12.server.info.vo.InfoMessageType;
import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Component;

@Component
public class InputClientHandler extends BaseClientHandler {


    @Override
    public void handler(ClientMessage message) {
        //广播到所有消息服务器
        InfoMessage infoMessage = toInfoMessage(message.getData(), message.getFrom(), message.getTo(), message.getNo(), InfoMessageType.Input);
        producer.send(properties.getInfoQueue(), JSON.toJSONString(infoMessage));
    }
}
